home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / 92052tar.gz / 920528.tar / mail_subr.c < prev    next >
C/C++ Source or Header  |  1991-06-04  |  934b  |  49 lines

  1. /* @(#) $Header: mail_subr.c,v 1.5 91/06/04 11:34:27 deyke Exp $ */
  2.  
  3. #include <stdlib.h>
  4. #include <string.h>
  5.  
  6. #include "timer.h"
  7. #include "mail.h"
  8.  
  9. /*---------------------------------------------------------------------------*/
  10.  
  11. char  *get_user_from_path(path)
  12. char  *path;
  13. {
  14.   char  *cp;
  15.  
  16.   return (cp = strrchr(path, '!')) ? cp + 1 : path;
  17. }
  18.  
  19. /*---------------------------------------------------------------------------*/
  20.  
  21. char  *get_host_from_path(path)
  22. char  *path;
  23. {
  24.  
  25.   char  *cp;
  26.   static char  tmp[1024];
  27.  
  28.   strcpy(tmp, path);
  29.   if (!(cp = strrchr(tmp, '!'))) return "";
  30.   *cp = '\0';
  31.   return (cp = strrchr(tmp, '!')) ? cp + 1 : tmp;
  32. }
  33.  
  34. /*---------------------------------------------------------------------------*/
  35.  
  36. void mailer_failed(sp)
  37. struct mailsys *sp;
  38. {
  39.   struct mailjob *jp;
  40.  
  41.   while (jp = sp->jobs) {
  42.     sp->jobs = jp->next;
  43.     free(jp);
  44.   }
  45.   sp->state = MS_FAILURE;
  46.   sp->nexttime = secclock() + RETRYTIME;
  47. }
  48.  
  49.